package top.mschen.blog.service.impl.oauth;

import org.springframework.security.oauth2.provider.client.JdbcClientDetailsService;

import javax.sql.DataSource;

/**
 *
 * 自定义clientdetail
 * clientDetailService
 */
public class MyClientDetailsService extends JdbcClientDetailsService {

    private static final String SELECT_CLIENT_MY_SQL = "select client_id, client_secret, resource_ids, scope, authorized_grant_types, " +
            "web_server_redirect_uri, authorities, access_token_validity, refresh_token_validity, additional_information, autoapprove " +
            "from oauth_client_details where client_id = ? and archived = 0 ";


    public MyClientDetailsService(DataSource dataSource) {
        super(dataSource);
        super.setSelectClientDetailsSql(SELECT_CLIENT_MY_SQL);
    }
}
